home *** CD-ROM | disk | FTP | other *** search
- head 1.5;
- branch ;
- access ;
- symbols sprited:1.5.1;
- locks ; strict;
- comment @ * @;
-
-
- 1.5
- date 88.07.29.17.08.39; author ouster; state Exp;
- branches 1.5.1.1;
- next 1.4;
-
- 1.4
- date 88.07.25.11.15.22; author ouster; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.07.01.14.02.04; author ouster; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.06.21.11.18.07; author ouster; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.06.19.14.29.16; author ouster; state Exp;
- branches ;
- next ;
-
- 1.5.1.1
- date 91.12.08.17.07.04; author kupfer; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.5
- log
- @Lint.
- @
- text
- @/*
- * Fs_WriteVector.c --
- *
- * Source code for the Fs_WriteVector library procedure.
- *
- * Copyright 1988 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- */
-
- #ifndef lint
- static char rcsid[] = "$Header: Fs_WriteVector.c,v 1.4 88/07/25 11:15:22 ouster Exp $ SPRITE (Berkeley)";
- #endif not lint
-
- #include <sprite.h>
- #include <fs.h>
- #include <status.h>
- #include <stdlib.h>
-
-
- /*
- *----------------------------------------------------------------------
- *
- * Fs_WriteVector --
- *
- * The "normal" Fs_WriteVector routine for user code. Write to the file
- * indicated by the stream ID from the buffers described in vectorArray.
- * The vectorArray indicates how much data to write, and amtWrittenPtr
- * is an output parameter that indicates how much data were written.
- *
- * Restarting from a signal is automatically handled by Fs_Write.
- *
- * Results:
- * Result from Fs_Write.
- *
- * Side effects:
- * See Fs_Write.
- *
- *----------------------------------------------------------------------
- */
-
- ReturnStatus
- Fs_WriteVector(streamID, numVectors, vectorArray, amtWrittenPtr)
- int streamID; /* The user's index into its open file list. */
- int numVectors; /* The # of vectors in userVectorArray. */
- Fs_IOVector vectorArray[]; /* The vectors defining where and how much to
- * write. */
- int *amtWrittenPtr; /* The amount of bytes actually written. */
- {
- register int i;
- register Fs_IOVector *vectorPtr;
- register int bufSize;
- Address buffer;
- Address ptr;
- ReturnStatus status;
-
- /*
- * Calculate the total number of bytes to be write.
- */
- bufSize = 0;
- for (i = 0, vectorPtr = vectorArray; i < numVectors; i++, vectorPtr++) {
- if (vectorPtr->bufSize < 0) {
- return SYS_INVALID_ARG;
- }
- bufSize += vectorPtr->bufSize;
- }
- buffer = (Address) malloc((unsigned) bufSize);
-
- /*
- * Copy the data from the individual buffers specified in the
- * vectorArray to the big buffer so the data can be written all at
- * once.
- */
- ptr = buffer;
- for (i = 0, vectorPtr = vectorArray; i < numVectors; i++, vectorPtr++) {
- bcopy(vectorPtr->buffer, ptr, vectorPtr->bufSize);
- ptr += vectorPtr->bufSize;
- }
-
- status = Fs_Write(streamID, bufSize, buffer, amtWrittenPtr);
- free((char *) buffer);
- return(status);
- }
- @
-
-
- 1.5.1.1
- log
- @Initial branch for Sprite server.
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/syscall/RCS/Fs_WriteVector.c,v 1.5 88/07/29 17:08:39 ouster Exp $ SPRITE (Berkeley)";
- @
-
-
- 1.4
- log
- @Lint.
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: Fs_WriteVector.c,v 1.3 88/07/01 14:02:04 ouster Exp $ SPRITE (Berkeley)";
- d72 1
- a72 1
- buffer = (Address) malloc(bufSize);
- @
-
-
- 1.3
- log
- @Remove calls to Stat_Error: they aren't needed anymore.
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: Fs_WriteVector.c,v 1.2 88/06/21 11:18:07 ouster Exp $ SPRITE (Berkeley)";
- d23 1
- a23 6
-
- /*
- * Library imports:
- */
-
- extern char *malloc();
- @
-
-
- 1.2
- log
- @Must include status.h.
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: Fs_WriteVector.c,v 1.1 88/06/19 14:29:16 ouster Exp $ SPRITE (Berkeley)";
- d73 1
- a73 1
- return Stat_Error(SYS_INVALID_ARG);
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
- d22 1
- @
-